//
//  MYRetweetView.m
//  奇闻
//
//  Created by 似水灵修 on 14-11-28.
//  Copyright (c) 2014年 MingYueGuCheng. All rights reserved.
//

#import "MYRetweetView.h"
#import "MYStatusCellTableViewCellFrame.h"
#import "MYStatus.h"
#import "MYUser.h"
#import "MYPhotosView.h"

@interface MYRetweetView ()
/**
 *  昵称
 */
@property (nonatomic, weak) UILabel *nameView;
/**
 *  内容
 */
@property (nonatomic, weak) UILabel *textView;
/**
 *  配图相册
 */
@property (nonatomic ,weak) MYPhotosView *photosView;
@end
@implementation MYRetweetView
- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        //添加所有子控件
        [self setupAllChildView];
        self.image = [UIImage resizedImageWithNamed:@"timeline_retweet_background"];
        self.userInteractionEnabled = YES;
    }
    return self;
}
 //添加所有子控件
- (void)setupAllChildView
{
    //昵称
    UILabel *nameView = [[UILabel alloc] init];
    nameView.textColor = MYRGBColor(52, 83, 86, 1);
    nameView.font = MYNameFont;
    [self addSubview:nameView];
    self.nameView = nameView;
    //内容
    UILabel *textView = [[UILabel alloc] init];
    textView.font = MYTextFont;
    textView.numberOfLines = 0;
    [self addSubview:textView];
    self.textView = textView;
    // 配图相册
    MYPhotosView *photosView = [[MYPhotosView alloc] init];
    [self addSubview:photosView];
    self.photosView = photosView;
}
- (void)setStatusF:(MYStatusCellTableViewCellFrame *)statusF
{
    _statusF = statusF;
    MYStatus *status = statusF.status;
    //昵称
    self.nameView.text = [NSString stringWithFormat:@"@%@", status.retweeted_status.user.name];
    self.nameView.frame = statusF.retweekViewNameF;
    
    //内容
    self.textView.text = status.retweeted_status.text;
    self.textView.frame = statusF.retweekViewTextF;
    // 配图相册
    self.photosView.pic_urls = status.pic_urls;
    self.photosView.frame = statusF.photosViewF;
}
@end
